def get_level_num(salesman, level):
    if salesman.leader:
        level += 1
        leader = salesman.leader
        return get_level_num(leader, level)
    return level


def compare_level(salesman):
    base_level_num = salesman.channel.level_num  # 层级
    print(base_level_num, "base_level_num")
    print(salesman.channel.id, "salesman.channel")
    if base_level_num:
        level_num = get_level_num(salesman, 1)
        print("level_num", level_num)
        print("base_level_num", base_level_num)
        if level_num >= base_level_num:
            return False
        else:
            return True
    return True
